import { instance } from "./api.interceptor"
import { IModel, IModelDto, ITest } from "../interfaces"



export const ModelServise = {
    async getOne(modelId: number): Promise<IModel> {
        const resp = await instance.get<IModel>(`/model/${modelId}`)
        return resp.data
    },

    async getAll(): Promise<IModel[]> {
        const resp = await instance.get<IModel[]>(`/model/`)
        return resp.data
    },

    async create(dto: IModelDto): Promise<IModel> {
        const resp = await instance.post<IModel>('/model', dto)
        return resp.data
    },

    async remove(id: number): Promise<IModel> {
        const resp = await instance.delete<IModel>(`/mode/${id}`)
        return resp.data
    }

}
